package com.password.desktop.util;

import java.awt.Font;
import java.io.File;
import java.net.URL;

import javax.swing.ImageIcon;

import com.password.util.SystemConfig;

public class SysUtil {
	private SysUtil() {
	}

	public final static File USER_SAVE_PATH = new File(SystemConfig.getContextPath(), ".userSaveInfo");
	/**
	 * 最小化图标
	 */
	public static final ImageIcon ICON_MIN = new ImageIcon(getResoure("images/min.png"));
	/**
	 * 关闭图标
	 */
	public static final ImageIcon ICON_CLOSE = new ImageIcon(getResoure("images/close.png"));
	/**
	 * logo图标
	 */
	public static final ImageIcon ICON_LOGO = new ImageIcon(getResoure("images/login/logo.png"));

	/**
	 * logo图标
	 */
	public static final ImageIcon ICON_LOGO_MIDDLE = new ImageIcon(getResoure("images/login/middle_logo.png"));

	/**
	 * 默认字体
	 */
	public static final Font FONT_DEFAULT_BLOD = new Font("微软雅黑", Font.BOLD, 18);
	public static final Font FONT_DEFAULT = new Font("微软雅黑", Font.PLAIN, 16);
	public static final Font FONT_DEFAULT_MIDDLE = new Font("微软雅黑", Font.PLAIN, 15);
	public static final Font FONT_DEFAULT_MIN = new Font("微软雅黑", Font.PLAIN, 12);

	static {
		if (!USER_SAVE_PATH.exists()) {
			USER_SAVE_PATH.mkdirs();
		}
	}

	public static URL getResoure(String path) {
		return SysUtil.class.getClassLoader().getResource(path);
	}

}
